//
//  GLBottomLineTextView.h
//  GLLibDemo
//
//  Created by huang long on 17/4/26.
//  Copyright © 2017年 历山大亚. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface GLBottomTextView : UITextView


/**
 *  cut:         剪切
 *  copy:        复制
 *  select:      选择
 *  selectAll:   全选
 *  paste:       粘贴
 *  delete:      删除
 *  _share:      分享
 *  _promptForReplace:
 *  _transliterateChinese:
 *  _showTextStyleOptions:
 *  _define:
 *  _addShortcut:
 *  _accessibilitySpeak:
 *  _accessibilityPauseSpeaking
 *  _accessibilitySpeakLanguageSelection:
 *  makeTextWritingDirectionRightToLeft:
 *  makeTextWritingDirectionLeftToRight:
 */
//Menu视图 能够用到的方法
@property(nonatomic , strong)NSArray * performActions;
//Menu视图 不能用到的方法
@property(nonatomic , strong)NSArray * unperformActions;

@end

@class GLBottomLineTextView;
@protocol GLBottomLineTextViewDelegate <NSObject>

@optional
/**
 *  glTextView 开始有文字 和 开始没有文字会被调用
 *
 *  @param glTextView TextView
 *  @param hasText    YES 代表开始文字了   NO 代表开始没有文字
 */
- (void)glTextView:(GLBottomLineTextView *)glTextView hasText:(BOOL)hasText;

- (BOOL)glTextViewShouldBeginEditing:(GLBottomLineTextView *)glTextView;

- (void)glTextViewDidBeginEditing:(GLBottomLineTextView *)glTextView;

- (void)glTextViewDidEndEditing:(GLBottomLineTextView *)glTextView;

- (void)glTextViewDidChange:(GLBottomLineTextView *)glTextView;

- (BOOL)glTextViewShouldReturn:(GLBottomLineTextView *)glTextView;

- (void)glTextView:(GLBottomLineTextView *)glTextView hasChange:(CGFloat)blHeight;

- (BOOL)glTextView:(GLBottomLineTextView *)glTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;

@end


@interface GLBottomLineTextView : UIView<UITextViewDelegate>

/*
 * @huanggulong
 *
 * 调用 initWithFrame: 方法时，maxHeight 默认为84
 *
 */
- (instancetype)initWithFrame:(CGRect)frame maxHeight:(CGFloat)maxHeight;

@property(nonatomic,strong,readonly)GLBottomTextView * textView;

@property(nonatomic , assign,readonly)CGFloat maxHeight;

@property(nonatomic , copy)NSString * text;

@property(nonatomic , strong)NSMutableAttributedString * attributedText;

@property(nonatomic , assign)NSInteger maxByteLength;

@property (nonatomic, assign,getter=isLineHide) BOOL lineHide;

//是否限制表情
@property(nonatomic , assign)BOOL limitEmoji;

//默认 提示字符字
@property(nonatomic , copy)NSString * placeholder;
//默认 提示字
@property(nonatomic,strong)UILabel *placeholderLabel;
//字体 大小
@property(nonatomic,strong)UIFont * font;
//代理
@property(nonatomic,assign)id<GLBottomLineTextViewDelegate> delegate;
//默认 提示字符字 颜色
@property(nonatomic , strong)UIColor * placeholderColor;


@end
